import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:gourmet/color/hex.dart';
import 'package:gourmet/extensions/ex_widget.dart';
import 'package:gourmet/ui/draw_under_line.dart';
import 'package:gourmet/utils/colors.dart';
import 'package:gourmet/utils/styles.dart';

class PrivacyManagementController extends GetxController {
  final double navHeight = 44 + Get.mediaQuery.padding.top;
  final double navTop = 44.0;
}

class PrivacyManagementPage extends GetView<PrivacyManagementController> {
  const PrivacyManagementPage({super.key});

  @override
  Widget build(BuildContext context) {
    return MediaQuery.removeViewPadding(
      context: context,
      removeBottom: true,
      removeLeft: true,
      removeRight: true,
      removeTop: true,
      child: Scaffold(
        backgroundColor: HexColor(ColorsUtils.colorF7f7),
        appBar: PreferredSize(
          preferredSize: Size.fromHeight(controller.navHeight),
          child: AnnotatedRegion<SystemUiOverlayStyle>(
            value: SystemUiOverlayStyle.dark,
            child: Container(
              color: HexColor(ColorsUtils.colorF7f7),
              height: controller.navHeight,
              padding: Get.mediaQuery.padding,
              child: Stack(
                children: [
                  Positioned(
                    width: 40,
                    height: controller.navTop,
                    top: 0,
                    left: 0,
                    child: Center(
                      child: Icon(
                        CupertinoIcons.chevron_back,
                        size: 20,
                        color: HexColor(ColorsUtils.color0000),
                      ),
                    ).onTap(Get.back),
                  ),
                  Center(
                    child: Text(
                      '隐私管理',
                      softWrap: true,
                      style: StylesUtils.customTextStyle(
                        fontSize: StylesUtils.fontSize16,
                        fontWeight: FontWeight.w700,
                        color: ColorsUtils.color0000,
                      ),
                    ),
                  ),
                ],
              ),
            ),
          ),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              Column(
                children: [
                  Container(
                    margin: const EdgeInsets.only(top: 10),
                    alignment: Alignment.center,
                    child: Container(
                      width: 345,
                      decoration: BoxDecoration(
                        borderRadius: BorderRadius.circular(10),
                        color: Colors.white,
                      ),
                      child: ListBody(
                        children: [
                          DrawUnderLine(
                            dx: 5,
                            child: Container(
                              height: 50,
                              padding:
                                  const EdgeInsets.symmetric(horizontal: 15),
                              child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '隐私政策',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color0000,
                                      fontSize: StylesUtils.fontSize15,
                                    ),
                                  ),
                                  Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 15,
                                    color: HexColor(ColorsUtils.color9999),
                                  )
                                ],
                              ),
                            ),
                          ),
                          DrawUnderLine(
                            dx: 5,
                            child: Container(
                              height: 50,
                              padding:
                                  const EdgeInsets.symmetric(horizontal: 15),
                              child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '隐私政策摘要',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color0000,
                                      fontSize: StylesUtils.fontSize15,
                                    ),
                                  ),
                                  Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 15,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ],
                              ),
                            ),
                          ),
                          DrawUnderLine(
                            dx: 5,
                            child: Container(
                              height: 50,
                              padding:
                                  const EdgeInsets.symmetric(horizontal: 15),
                              child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '应用权限说明',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color0000,
                                      fontSize: StylesUtils.fontSize15,
                                    ),
                                  ),
                                  Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 15,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ],
                              ),
                            ),
                          ),
                          DrawUnderLine(
                            dx: 5,
                            child: Container(
                              height: 50,
                              padding:
                                  const EdgeInsets.symmetric(horizontal: 15),
                              child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '个人信息收集清单',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color0000,
                                      fontSize: StylesUtils.fontSize15,
                                    ),
                                  ),
                                  Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 15,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ],
                              ),
                            ),
                          ),
                          DrawUnderLine(
                            dx: 5,
                            child: Container(
                              height: 50,
                              padding:
                                  const EdgeInsets.symmetric(horizontal: 15),
                              child: Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '第三方共享个人信息清单',
                                    style: StylesUtils.customTextStyle(
                                      color: ColorsUtils.color0000,
                                      fontSize: StylesUtils.fontSize15,
                                    ),
                                  ),
                                  Icon(
                                    CupertinoIcons.chevron_forward,
                                    size: 15,
                                    color: HexColor(ColorsUtils.color9999),
                                  ),
                                ],
                              ),
                            ),
                          ),
                          Container(
                            height: 50,
                            padding: const EdgeInsets.symmetric(horizontal: 15),
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Text(
                                  '未成人隐私政策',
                                  style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color0000,
                                    fontSize: StylesUtils.fontSize15,
                                  ),
                                ),
                                Icon(
                                  CupertinoIcons.chevron_forward,
                                  size: 15,
                                  color: HexColor(ColorsUtils.color9999),
                                )
                              ],
                            ),
                          )
                        ],
                      ),
                    ),
                  )
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}
